package com.example.handler;

import com.example.filter.SSOFilter;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;

import java.io.IOException;

/**
 * 初始化Handler
 */
public class InitHandler implements HttpHandler {
    @Override
    public void handle(HttpExchange httpExchange) throws IOException {
        String path = httpExchange.getRequestURI().getPath();
        if(path.startsWith("/static")){
            HttpHandler handler = new StaticHandler();
            handler.handle(httpExchange);
        }else {
            System.out.println("=====非静态访问======");
            HttpHandler handler = new LoginHandler();
            handler.handle(httpExchange);
        }
    }
}
